# 导包
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

# 获取浏览器驱动
driver = webdriver.Firefox()
# 打开测试的网址
url = 'file:///C:/Users/tedu/Desktop/NSD2407/html/registerA.html'
driver.get(url)

# 定位用户名输入admin
username = driver.find_element(By.CSS_SELECTOR, '#userA')
username.send_keys('admin')
# 停顿3秒，清空后，再重新输入用户名hello
sleep(3)
username.clear()
username.send_keys('hello')
sleep(3)
driver.find_element(By.CSS_SELECTOR, '[value="注册A"]').click()

# 停顿3秒，关闭浏览器
sleep(3)
driver.quit()